package org.cqipc.edu.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.cqipc.edu.entity.User;

/**
 * @Description: 用户-数据层
 * @ClassNmae: UserMapper
 * @Author: HeYue
 * @DateTime: 2020-10-30 19:47
 **/
public interface UserDao {

    @Select("select * from user where user_name = #{username}")
    User queryUserName(String username);

    @Select("select * from user where user_id = #{id}")
    User queryUserId(Integer id);

    @Select("select * from user where user_password = #{password}")
    User queryUserPassword(String password);

    @Select("select * from user where user_name = #{username} and user_password = #{password}")
    User queryUserNameAndPassword(@Param("username") String username, @Param("password") String password);

    @Insert("insert into user values (null,#{userName},#{userPassword},1,#{userTime},1)")
    boolean insertUser(User user);

}
